﻿#ifndef _CQUE_H_
#define _CQUE_H_
#include "CSem.h"
#include "CList.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _cque_ {
	//attribute
	CList list;
	int is_with_lock;
	CSem lock;

	//action
	int(*push)(struct _cque_*, void* v);
	void* (*pop)(struct _cque_* thes);
	int(*release)(struct _cque_* thes);
} CQue;

void construct_queue(CQue* thes, int with_lock);

#ifdef __cplusplus
}
#endif
#endif
